<template>
	<view class="container">
		<!-- <uni-card :is-shadow="false" is-full>
			<text class="uni-h6">uni-forms 组件一般由输入框、选择器、单选框、多选框等控件组成，用以收集、校验、提交数据。</text>
		</uni-card> -->
		<uni-section title="基本信息" type="line">
			<view class="example">
				<!-- 基础用法，不包含校验规则 -->
				<uni-forms ref="baseForm" :modelValue="baseFormData.personInfo" :rules="rules">
					<uni-forms-item label="姓名" required class="cst-form-item" :labelWidth='105' name="XM">
						<uni-easyinput v-model="baseFormData.personInfo.XM" placeholder="请输入姓名" :inputBorder="false"/>
					</uni-forms-item>
					<uni-forms-item label="民族" required class="cst-form-item" :labelWidth='105' name="MZ">
						<uni-data-select v-model="baseFormData.personInfo.MZ" :localdata="nationOptions" :clear="true" placeholder="请选择民族"></uni-data-select>
					</uni-forms-item>
					<uni-forms-item label="身份证号" required class="cst-form-item" :labelWidth='105' name="SFZH">
						<uni-easyinput v-model="baseFormData.personInfo.SFZH" placeholder="请输入身份证号" :inputBorder="false" @input="idcardChange"/>
					</uni-forms-item>
					<uni-forms-item label="出生年月" required class="cst-form-item" :labelWidth='105' name="CSNY">
						<uni-datetime-picker v-model="baseFormData.personInfo.CSNY" placeholder="请选择出生年月" type="date" :clear-icon="true"  :border="false"/>
					</uni-forms-item>
					<uni-forms-item label="性别" required class="cst-form-item" :labelWidth='105' name="XB">
						<uni-data-select v-model="baseFormData.personInfo.XB" :localdata="genderOptions" :clear="true" placeholder="请选择性别"></uni-data-select>
					</uni-forms-item>
					<uni-forms-item label="年龄" required class="cst-form-item" :labelWidth='105' name="NL">
						<uni-easyinput v-model="baseFormData.personInfo.NL" placeholder="请输入年龄" :inputBorder="false"/>
					</uni-forms-item>
					<uni-forms-item label="专业名称" required class="cst-form-item" :labelWidth='105' name="ZYZC">
						<song-data-picker :border="false" :openSearch="true" v-model="baseFormData.personInfo.ZYZC" :localdata="specialityOptions" :clear="true" placeholder="请选择专业名称"></song-data-picker>
					</uni-forms-item>
					<uni-forms-item label="技术职称" required class="cst-form-item" :labelWidth='105' name="JSZC">
						 <uni-data-picker v-model="baseFormData.personInfo.JSZC" :localdata="titleOptions" popup-title="请选择技术职称" :border="false" placeholder="请选择技术职称"></uni-data-picker>
					</uni-forms-item>
					<uni-forms-item label="籍贯" required class="cst-form-item" :labelWidth='105' name="JG">
						<uni-data-picker v-model="baseFormData.personInfo.JG" :map="{text:'text',value:'code'}" :localdata="areaOptions" popup-title="请选择籍贯" :border="false" placeholder="请选择籍贯"></uni-data-picker>
					</uni-forms-item>
					<uni-forms-item label="常住地" required class="cst-form-item" :labelWidth='105' name="CZD">
						<uni-data-picker :openSearch="true" v-model="baseFormData.personInfo.CZD" :map="{text:'text',value:'code'}" :localdata="areaOptions" popup-title="请选择常住地" :border="false" placeholder="请选择常住地"></uni-data-picker>
					</uni-forms-item>
					<uni-forms-item label="联系电话" required class="cst-form-item" :labelWidth='105' name="LXDH">
						<uni-easyinput v-model="baseFormData.personInfo.LXDH" placeholder="请输入联系电话" :inputBorder="false"/>
					</uni-forms-item>
					<uni-forms-item label="下沉意愿" required class="cst-form-item" :labelWidth='105' name="XCYY">
						<uni-data-select v-model="baseFormData.personInfo.XCYY" :localdata="godeepOptions" :clear="true" placeholder="请选择下沉意愿"></uni-data-select>
					</uni-forms-item>
					<uni-forms-item label="退休所在单位" required class="cst-form-item" :labelWidth='105' name="UPID_">
						<uni-data-picker v-model="baseFormData.personInfo.UPID_" :map="{text:'text',value:'code'}" :localdata="institutionOptions"
						popup-title="请选择退休所在单位"  :border="false" placeholder="请选择退休所在单位" ></uni-data-picker>
					</uni-forms-item>
					<uni-forms-item label="身体状况" required class="cst-form-item" :labelWidth='105' name="STZK">
						<uni-easyinput v-model="baseFormData.personInfo.STZK" placeholder="请输入身体状况" :inputBorder="false"/>
					</uni-forms-item>
					<view class="uni-btn-v">
						<button v-if="baseFormData.reportStatus == '0' || baseFormData.reportStatus == '3'" type="primary" @click="uploadUserInfo('baseForm')">提交审核</button>
						<button v-if="baseFormData.reportStatus == '1' || baseFormData.reportStatus == '2'" type="primary" disabled="true">基本信息审核中</button>
						<uni-row v-if="baseFormData.reportStatus == '4'" class="demo-uni-row">
							<uni-col :span="8">
								<button @click="uploadUserInfo('baseForm')">修改</button>
							</uni-col>
							<uni-col :span="1">
								&nbsp;
							</uni-col>
							<uni-col :span="15">
								<button type="primary" @click="navTo('/pages/retire/main/report2')">下一步</button>
							</uni-col>
						</uni-row>
					</view>
					<input type="hidden" name="id" v-model="baseFormData.personInfo.id"/>
				</uni-forms>
			</view>
		</uni-section>
	</view>
</template>

<script>
	import apiConfig  from "/api/config.js"
	import CryptoJS from 'crypto-js'
	export default {
		data() {
			return {
				genderOptions: [
						{ value: "0", text: "未知的性别" },
						{ value: "1", text: "男" },
						{ value: "2", text: "女" },
						{ value: "9", text: "未说明的性别" },
					],
				institutionOptions:[],
				nationOptions: [
						{ value: "01", text: "汉族" }, 
						{ value: "02", text: "蒙古族" },
						{ value: "03", text: "回族" },
						{ value: "04", text: "藏族" },
						{ value: "05", text: "维吾尔族" },
						{ value: "06", text: "苗族" },
						{ value: "07", text: "彝族" },
						{ value: "08", text: "壮族" },
						{ value: "09", text: "布依族" },
						{ value: "10", text: "朝鲜族" },
						{ value: "11", text: "满族" },
						{ value: "12", text: "侗族" },
						{ value: "13", text: "瑶族" },
						{ value: "14", text: "白族" },
						{ value: "15", text: "土家族" },
						{ value: "16", text: "哈尼族" },
						{ value: "17", text: "哈萨克族" },
						{ value: "18", text: "傣族" },
						{ value: "19", text: "黎族" },
						{ value: "20", text: "傈僳族" },
						{ value: "21", text: "佤族" },
						{ value: "22", text: "畲族" },
						{ value: "23", text: "高山族" },
						{ value: "24", text: "拉祜族" },
						{ value: "25", text: "水族" },
						{ value: "26", text: "东乡族" },
						{ value: "27", text: "纳西族" },
						{ value: "28", text: "景颇族" },
						{ value: "29", text: "柯尔克孜" },
						{ value: "30", text: "土族" },
						{ value: "31", text: "达斡尔族" },
						{ value: "32", text: "仫佬族" },
						{ value: "33", text: "羌族" },
						{ value: "34", text: "布朗族" },
						{ value: "35", text: "撒拉族" },
						{ value: "36", text: "毛南族" },
						{ value: "37", text: "仡佬族" },
						{ value: "38", text: "锡伯族" },
						{ value: "39", text: "阿昌族" },
						{ value: "40", text: "普米族" },
						{ value: "41", text: "塔吉克族" },
						{ value: "42", text: "怒族" },
						{ value: "43", text: "乌孜别克" },
						{ value: "44", text: "俄罗斯族" },
						{ value: "45", text: "鄂温克族" },
						{ value: "46", text: "崩龙族" },
						{ value: "47", text: "保安族" },
						{ value: "48", text: "裕固族" },
						{ value: "49", text: "京族" },
						{ value: "50", text: "塔塔尔族" },
						{ value: "51", text: "独龙族" },
						{ value: "52", text: "鄂伦春族" },
						{ value: "53", text: "赫哲族" },
						{ value: "54", text: "门巴族" },
						{ value: "55", text: "珞巴族" },
						{ value: "56", text: "基诺族" },
						{ value: "99", text: "其他" },
					],
				specialityOptions: [
						// { value: "1", text: "正高" },
						// { value: "2", text: "副高" },
						// { value: "3", text: "中级" },
						// { value: "4", text: "师级/助理" },
						// { value: "5", text: "士级" },
						// { value: "9", text: "待聘" },
						{ value: "11", text: "执业医师" },
						{ value: "12", text: "执业助理医师" },
						{ value: "13", text: "见习医师" },
						{ value: "21", text: "注册护士" },
						{ value: "22", text: "助产士" },
						{ value: "31", text: "西药师（士）" },
						{ value: "32", text: "中药师（士）" },
						{ value: "41", text: "检验技师（士）" },
						{ value: "42", text: "影像技师（士）" },
						{ value: "43", text: "康复技师" },
						{ value: "44", text: "其他技师" },
						{ value: "50", text: "卫生监督员" },
						{ value: "60", text: "乡村医生" },
						{ value: "69", text: "其他卫生技术人员" },
						{ value: "70", text: "其他技术人员" },
						{ value: "80", text: "管理人员" },
						{ value: "90", text: "工勤技能人员" },
					],
				titleOptions: [
					// { value: "01", text: "高等学校教师",children: [
					//   { value: "011", text: "教授"},
					//   { value: "012", text: "副教授"},
					//   { value: "013", text: "讲师"},
					//   { value: "014", text: "助教"},]},
					// { value: "02", text: "中等专业学校教师",children: [
					//   { value: "021", text: "正高级讲师(中专)"},
					//   { value: "022", text: "高级讲师(中专)"},
					//   { value: "023", text: "讲师(中专)"},
					//   { value: "024", text: "助理讲师(中专)"},
					//   { value: "025", text: "教员(中专)"},]},
					// { value: "03", text: "技工学校教师（讲师）",children: [
					//   { value: "031", text: "正高级讲师(技校)"},
					//   { value: "032", text: "高级讲师(技校)"},
					//   { value: "033", text: "讲师(技校)"},
					//   { value: "034", text: "助理讲师(技校)"},
					//   { value: "035", text: "教员(技校)"},]},
					// { value: "04", text: "技工学校教师(实习指导)",children: [
					//   { value: "041", text: "正高级实习指导教师"},
					//   { value: "042", text: "高级实习指导教师"},
					//   { value: "043", text: "一级实习指导教师"},
					//   { value: "044", text: "二级实习指导教师"},
					//   { value: "045", text: "三级实习指导教师"},]},
					// { value: "05", text: "中学教师",children: [
					//   { value: "051", text: "正高级教师(中学)"},
					//   { value: "052", text: "高级教师(中学)"},
					//   { value: "053", text: "一级教师(中学)"},
					//   { value: "054", text: "二级教师(中学)"},
					//   { value: "055", text: "三级教师(中学)"},]},
					// { value: "07", text: "实验技术人员",children: [
					//   { value: "071", text: "正高级实验师"},
					//   { value: "072", text: "高级实验师"},
					//   { value: "073", text: "实验师"},
					//   { value: "074", text: "助理实验师"},
					//   { value: "075", text: "实验员"},]},
					// { value: "08", text: "工程技术人员",children: [
					//   { value: "081", text: "教授级高级工程师"},
					//   { value: "082", text: "高级工程师"},
					//   { value: "083", text: "工程师"},
					//   { value: "084", text: "助理工程师"},
					//   { value: "085", text: "技术员"},]},
					// { value: "09", text: "农业技术人员（农艺）",children: [
					//   { value: "091", text: "正高级农艺师"},
					//   { value: "092", text: "高级农艺师"},
					//   { value: "093", text: "农艺师"},
					//   { value: "094", text: "助理农艺师"},
					//   { value: "095", text: "农业技术员"},]},
					// { value: "10", text: "农业技术人员（兽医）",children: [
					//   { value: "101", text: "正高级兽医师"},
					//   { value: "102", text: "高级兽医师"},
					//   { value: "103", text: "兽医师"},
					//   { value: "104", text: "助理兽医师"},
					//   { value: "105", text: "兽医技术员"},]},
					// { value: "11", text: "农业技术人员（畜牧）",children: [
					//   { value: "111", text: "正高级畜牧师"},
					//   { value: "112", text: "高级畜牧师"},
					//   { value: "113", text: "畜牧师"},
					//   { value: "114", text: "助理畜牧师"},
					//   { value: "115", text: "畜牧技术员"},]},
					// { value: "12", text: "经济专业人员",children: [
					//   { value: "121", text: "正高级经济师"},
					//   { value: "122", text: "高级经济师"},
					//   { value: "123", text: "经济师"},
					//   { value: "124", text: "助理经济师"},
					//   { value: "125", text: "经济员"},]},
					// { value: "13", text: "会计专业人员",children: [
					//   { value: "131", text: "正高级会计师"},
					//   { value: "132", text: "高级会计师"},
					//   { value: "133", text: "会计师"},
					//   { value: "134", text: "助理会计师"},
					//   { value: "135", text: "会计员"},]},
					// { value: "14", text: "统计专业人员",children: [
					//   { value: "141", text: "正高级统计师"},
					//   { value: "142", text: "高级统计师"},
					//   { value: "143", text: "统计师"},
					//   { value: "144", text: "助理统计师"},
					//   { value: "145", text: "统计员"},]},
					// { value: "15", text: "出版专业人员（编审）",children: [
					//   { value: "151", text: "编审"},
					//   { value: "152", text: "副编审"},
					//   { value: "153", text: "编辑"},
					//   { value: "154", text: "助理编辑"},]},
					// { value: "16", text: "出版专业人员（编辑）",children: [
					//   { value: "161", text: "正高级编辑"},
					//   { value: "162", text: "高级编辑"},
					//   { value: "163", text: "技术编辑"},
					//   { value: "164", text: "助理技术编辑"},
					//   { value: "165", text: "技术设计员"},]},
					// { value: "17", text: "出版专业人员（校对）",children: [
					//   { value: "171", text: "正高级校对"},
					//   { value: "172", text: "高级校对"},
					//   { value: "173", text: "一级校对"},
					//   { value: "174", text: "二级校对"},
					//   { value: "175", text: "三级校对"},]},
					// { value: "18", text: "翻译人员",children: [
					//   { value: "181", text: "译审"},
					//   { value: "182", text: "副译审"},
					//   { value: "183", text: "翻译"},
					//   { value: "184", text: "助理翻译"},]},
					// { value: "19", text: "新闻专业人员（记者）",children: [
					//   { value: "191", text: "高级记者"},
					//   { value: "192", text: "主任记者"},
					//   { value: "193", text: "记者"},
					//   { value: "194", text: "助理记者"},]},
					// { value: "20", text: "新闻专业人员（编辑）",children: [
					//   { value: "201", text: "高级编辑"},
					//   { value: "202", text: "主任编辑"},
					//   { value: "203", text: "编辑"},
					//   { value: "204", text: "助理编辑"},]},
					// { value: "22", text: "播音员",children: [
					//   { value: "221", text: "播音指导"},
					//   { value: "222", text: "主任播音员"},
					//   { value: "223", text: "一级播音员"},
					//   { value: "224", text: "二级播音员"},
					//   { value: "225", text: "三级播音员"},]},
					{ value: "23", text: "卫生技术人员（医疗）",children: [
					  { value: "231", text: "主任医师"},
					  { value: "232", text: "副主任医师"},
					  { value: "233", text: "主治医师"},
					  { value: "234", text: "医师"},
					  { value: "235", text: "医士"},]},
					{ value: "24", text: "卫生技术人员（药剂）",children: [
					  { value: "241", text: "主任药师"},
					  { value: "242", text: "副主任药师"},
					  { value: "243", text: "主管药师"},
					  { value: "244", text: "药师"},
					  { value: "245", text: "药士"},]},
					{ value: "25", text: "卫生技术人员（护理）",children: [
					  { value: "251", text: "主任护师"},
					  { value: "252", text: "副主任护师"},
					  { value: "253", text: "主管护师"},
					  { value: "254", text: "护师"},
					  { value: "255", text: "护士"},]},
					{ value: "26", text: "卫生技术人员（技师）",children: [
					  { value: "261", text: "主任技师"},
					  { value: "262", text: "副主任技师"},
					  { value: "263", text: "主管技师"},
					  { value: "264", text: "技师"},
					  { value: "265", text: "技士"},]},
					// { value: "27", text: "工艺美术人员",children: [
					//   { value: "271", text: "正高级工艺美术师"},
					//   { value: "272", text: "高级工艺美术师"},
					//   { value: "273", text: "工艺美术师"},
					//   { value: "274", text: "助理工艺美术师"},
					//   { value: "275", text: "工艺美术员"},]},
					// { value: "28", text: "艺术人员（演员）",children: [
					//   { value: "281", text: "一级演员"},
					//   { value: "282", text: "二级演员"},
					//   { value: "283", text: "三级演员"},
					//   { value: "284", text: "四级演员"},]},
					// { value: "29", text: "艺术人员（演奏员）",children: [
					//   { value: "291", text: "一级演奏员"},
					//   { value: "292", text: "二级演奏员"},
					//   { value: "293", text: "三级演奏员"},
					//   { value: "294", text: "四级演奏员"},]},
					// { value: "30", text: "艺术人员（编剧）",children: [
					//   { value: "301", text: "一级编剧"},
					//   { value: "302", text: "二级编剧"},
					//   { value: "303", text: "三级编剧"},
					//   { value: "304", text: "四级编剧"},]},
					// { value: "31", text: "艺术人员（导演）",children: [
					//   { value: "311", text: "一级导演"},
					//   { value: "312", text: "二级导演"},
					//   { value: "313", text: "三级导演"},
					//   { value: "314", text: "四级导演"},]},
					// { value: "32", text: "艺术人员（指挥）",children: [
					//   { value: "321", text: "一级指挥"},
					//   { value: "322", text: "二级指挥"},
					//   { value: "323", text: "三级指挥"},
					//   { value: "324", text: "四级指挥"},]},
					// { value: "33", text: "艺术人员（作曲）",children: [
					//   { value: "331", text: "一级作曲"},
					//   { value: "332", text: "二级作曲"},
					//   { value: "333", text: "三级作曲"},
					//   { value: "334", text: "四级作曲"},]},
					// { value: "34", text: "艺术人员（美术）",children: [
					//   { value: "341", text: "一级美术师"},
					//   { value: "342", text: "二级美术师"},
					//   { value: "343", text: "三级美术师"},
					//   { value: "344", text: "美术员"},]},
					// { value: "35", text: "艺术人员（舞美设计）",children: [
					//   { value: "351", text: "一级舞美设计师"},
					//   { value: "352", text: "二级舞美设计师"},
					//   { value: "353", text: "三级舞美设计师"},
					//   { value: "354", text: "舞美设计员"},]},
					// { value: "36", text: "艺术人员（舞台技术）",children: [
					//   { value: "361", text: "正高级舞台技师"},
					//   { value: "362", text: "主任舞台技师"},
					//   { value: "363", text: "舞台技师"},
					//   { value: "364", text: "舞台技术员"},]},
					// { value: "37", text: "体育教练",children: [
					//   { value: "371", text: "正高级教练"},
					//   { value: "372", text: "高级教练"},
					//   { value: "373", text: "一级教练"},
					//   { value: "374", text: "二级教练"},
					//   { value: "375", text: "三级教练"},]},
					// { value: "38", text: "海关人员",children: [
					//   { value: "381", text: "正高级关务监督"},
					//   { value: "382", text: "高级关务监督"},
					//   { value: "383", text: "关务监督"},
					//   { value: "384", text: "助理关务监督"},
					//   { value: "385", text: "监督员"},]},
					// { value: "39", text: "律师",children: [
					//   { value: "391", text: "一级律师"},
					//   { value: "392", text: "二级律师"},
					//   { value: "393", text: "三级律师"},
					//   { value: "394", text: "四级律师"},
					//   { value: "395", text: "律师助理"},]},
					// { value: "40", text: "公证员",children: [
					//   { value: "401", text: "一级公证员"},
					//   { value: "402", text: "二级公证员"},
					//   { value: "403", text: "三级公证员"},
					//   { value: "404", text: "四级公证员"},
					//   { value: "405", text: "公证员助理"},]},
					// { value: "41", text: "小学教师",children: [
					//   { value: "411", text: "正高级教师(小学)"},
					//   { value: "413", text: "高级教师(小学)"},
					//   { value: "414", text: "一级教师(小学)"},
					//   { value: "415", text: "二级教师(小学)"},
					//   { value: "416", text: "三级教师(小学)"},]},
					// { value: "42", text: "船舶技术人员（驾驶）",children: [
					//   { value: "421", text: "正高级船长"},
					//   { value: "422", text: "高级船长"},
					//   { value: "423", text: "船长（大副）"},
					//   { value: "424", text: "二副"},
					//   { value: "425", text: "三副"},]},
					// { value: "43", text: "船舶技术人员（轮机）",children: [
					//   { value: "431", text: "正高级轮机长"},
					//   { value: "432", text: "高级轮机长"},
					//   { value: "433", text: "轮机长(大管轮)"},
					//   { value: "434", text: "二管轮"},
					//   { value: "435", text: "三管轮"},]},
					// { value: "44", text: "船舶技术人员（电机）",children: [
					//   { value: "441", text: "正高级电机员"},
					//   { value: "442", text: "高级电机员"},
					//   { value: "443", text: "通用电机员(一等电机员)"},
					//   { value: "444", text: "二等电机员"},]},
					// { value: "45", text: "船舶技术人员（报务）",children: [
					//   { value: "451", text: "正高级报务员"},
					//   { value: "452", text: "高级报务员"},
					//   { value: "453", text: "通用报务员"},
					//   { value: "454", text: "二等报务员"},
					//   { value: "455", text: "限用报务员"},]},
					// { value: "46", text: "民用航空飞行技术人员（驾驶）",children: [
					//   { value: "461", text: "正高级飞行员"},
					//   { value: "462", text: "一级飞行员"},
					//   { value: "463", text: "二级飞行员"},
					//   { value: "464", text: "三级飞行员"},
					//   { value: "465", text: "四级飞行员"},]},
					// { value: "47", text: "民用航空飞行技术人员（领航）",children: [
					//   { value: "471", text: "正高级领航员"},
					//   { value: "472", text: "一级领航员"},
					//   { value: "473", text: "二级领航员"},
					//   { value: "474", text: "三级领航员"},
					//   { value: "475", text: "四级领航员"},]},
					// { value: "48", text: "民用航空飞行技术人员（通信）",children: [
					//   { value: "481", text: "正高级飞行通信员"},
					//   { value: "482", text: "一级飞行通信员"},
					//   { value: "483", text: "二级飞行通信员"},
					//   { value: "484", text: "三级飞行通信员"},
					//   { value: "485", text: "四级飞行通信员"},]},
					// { value: "49", text: "民用航空飞行技术人员（机械）",children: [
					//   { value: "491", text: "正高级飞行机械员"},
					//   { value: "492", text: "一级飞行机械员"},
					//   { value: "493", text: "二级飞行机械员"},
					//   { value: "494", text: "三级飞行机械员"},
					//   { value: "495", text: "四级飞行机械员"},]},
					// { value: "50", text: "民用航空飞行技术人员(引航)",children: [
					//   { value: "501", text: "正高级引航员"},
					//   { value: "502", text: "高级引航员"},
					//   { value: "503", text: "一、二级引航员"},
					//   { value: "504", text: "三、四级引航员"},]},
					// { value: "61", text: "自然科学研究人员",children: [
					//   { value: "611", text: "研究员(自然科学)"},
					//   { value: "612", text: "副研究员(自然科学)"},
					//   { value: "613", text: "助理研究员(自然科学)"},
					//   { value: "614", text: "研究实习员(自然科学)"},]},
					// { value: "62", text: "自然科学研究人员",children: [
					//   { value: "621", text: "研究员(社会科学)"},
					//   { value: "622", text: "副研究员(社会科学)"},
					//   { value: "623", text: "助理研究员(社会科学)"},
					//   { value: "624", text: "研究实习员(社会科学)"},]},
					// { value: "64", text: "图书资料专业人员",children: [
					//   { value: "641", text: "研究馆员(图书)"},
					//   { value: "642", text: "副研究馆员(图书)"},
					//   { value: "643", text: "馆员(图书)"},
					//   { value: "644", text: "助理馆员(图书)"},
					//   { value: "645", text: "管理员(图书)"},]},
					// { value: "65", text: "文博专业人员",children: [
					//   { value: "651", text: "研究馆员(文博)"},
					//   { value: "652", text: "副研究馆员(文博)"},
					//   { value: "653", text: "馆员(文博)"},
					//   { value: "654", text: "助理馆员(文博)"},
					//   { value: "655", text: "管理员(文博)"},]},
					// { value: "66", text: "档案专业人员",children: [
					//   { value: "661", text: "研究馆员(档案)"},
					//   { value: "662", text: "副研究馆员(档案)"},
					//   { value: "663", text: "馆员(档案)"},
					//   { value: "664", text: "助理馆员(档案)"},
					//   { value: "665", text: "管理员(档案)"},]},
					// { value: "67", text: "群众文化专业人员",children: [
					//   { value: "671", text: "研究馆员(群众文化)"},
					//   { value: "672", text: "副研究馆员(群众文化)"},
					//   { value: "673", text: "馆员(群众文化)"},
					//   { value: "674", text: "助理馆员(群众文化)"},
					//   { value: "675", text: "管理员(群众文化)"},]},
					// { value: "68", text: "审计专业人员",children: [
					//   { value: "681", text: "正高级审计师"},
					//   { value: "682", text: "高级审计师"},
					//   { value: "683", text: "审计师"},
					//   { value: "684", text: "助理审计师"},
					//   { value: "685", text: "审计员"},]},
					// { value: "69", text: "法医专业人员",children: [
					//   { value: "691", text: "主任法医师"},
					//   { value: "692", text: "副主任法医师"},
					//   { value: "693", text: "主检法医师"},
					//   { value: "694", text: "法医师"},
					//   { value: "695", text: "法医士"},]},
					// { value: "98", text: "思想政治工作人员",children: [
					//   { value: "981", text: "正高级政工师"},
					//   { value: "982", text: "高级政工师"},
					//   { value: "983", text: "政工师"},
					//   { value: "984", text: "助理政工师"},
					//   { value: "985", text: "政工员"},]},
					// { value: "00", text: "未评",children: [
					//   { value: "000", text: "未评"},]}
				],
				godeepOptions:[
						{ value: "1", text: "是" },
						{ value: "0", text: "否" },
					],
				areaOptions:[],
				baseFormData: {
					reportStatus:'0',
					// 基础表单数据
					personInfo: {}
				},
				originBasicInfo: {},
				// 校验规则
				rules: {
					XM: {
						rules: [{
							required: true,
							errorMessage: '姓名不能为空'
						}]
					},
					MZ: {
						rules: [{
							required: true,
							errorMessage: '民族不能为空'
						}]
					},
					SFZH: {
						rules: [{
							required: true,
							errorMessage: '身份证号不能为空'
						}]
					},
					CSNY: {
						rules: [{
							required: true,
							errorMessage: '出生年月不能为空'
						}]
					},
					XB: {
						rules: [{
							required: true,
							errorMessage: '性别不能为空'
						}]
					},
					NL: {
						rules: [{
							required: true,
							errorMessage: '年龄不能为空'
						}, {
							format: 'number',
							errorMessage: '年龄只能输入数字'
						}]
					},
					ZYZC: {
						rules: [{
							required: true,
							errorMessage: '专业名称不能为空'
						}]
					},
					JSZC: {
						rules: [{
							required: true,
							errorMessage: '技术职称不能为空'
						}]
					},
					nativePlace: {
						rules: [{
							required: true,
							errorMessage: '技术职称不能为空'
						}]
					},
					CZD: {
						rules: [{
							required: true,
							errorMessage: '常住地不能为空'
						}]
					},
					JG: {
						rules: [{
							required: true,
							errorMessage: '籍贯不能为空'
						}]
					},
					LXDH: {
						rules: [{
							required: true,
							errorMessage: '联系方式不能为空'
						}]
					},
					XCYY: {
						rules: [{
							required: true,
							errorMessage: '下沉意愿不能为空'
						}]
					},
					UPID_: {
						rules: [{
							required: true,
							errorMessage: '退休所在单位不能为空'
						}]
					},
					STZK: {
						rules: [{
							required: true,
							errorMessage: '身体状况不能为空'
						}]
					},
				},
			}
		},
		computed: {
		},
		onLoad(option) {
			// 加载字典
			this.loadInstitutionOptions();
			this.loadAreaOptions();
			// 获取个人下沉信息
			this.getUserInfo();
		},
		onReady() {
		},
		methods: {
			loadInstitutionOptions(){
				uni.request({
					url: apiConfig.api_host + "/wsb/interface/txywryxc.do?action=getDictionaryData&dictionaryName=ul_HBZB_S_" ,
					success: data => {
						var decrypt = this.aes_decrypt(data.data)
						var rstData = JSON.parse(decrypt.replace(/[^\x20-\x7E\u4E00-\u9FFF]+/g, ""));
						console.log("机构信息", rstData.data.data);
						
						this.institutionOptions = rstData.data.data[0].children[0].children;
					},
					fail: (data, code) => {
						console.log('fail', data);
					}
				});
			},
			loadAreaOptions(){
				uni.request({
					url: apiConfig.api_host + "/wsb/interface/txywryxc.do?action=getDictionaryData&dictionaryName=DIM_XZQH_HB" ,
					success: data => {
						var decrypt = this.aes_decrypt(data.data)
						var rstData = JSON.parse(decrypt.replace(/[^\x20-\x7E\u4E00-\u9FFF]+/g, ""));
						console.log("区域信息", rstData.data.data[0].children);
						this.areaOptions = rstData.data.data[0].children;
					},
					fail: (data, code) => {
						console.log('fail', data);
					}
				});
			},
			getUserInfo(){
				// console.log(this.aes_d	ecrypt("zGxdMSjAqTJtKayvCFO6nnbHbL6SP20ZIxgAsJDuzds="))
				uni.request({
					url: apiConfig.api_host + "/wsb/interface/txywryxc.do?action=getUserInfo&sign=" + this.$sign,
					success: data => {
						console.log(data.data.replaceAll(" ", ""))
						var decrypt = this.aes_decrypt(data.data.replaceAll(" ", ""))
						console.log("个人信息", data.data, decrypt);
						console.log(this.aes_decrypt('eRDmwKBDpItnuMVKFBOuYfoYkSOZDzFryB5+i+rSqcNdyv8NSypGsq9oMsg6c1OqHvvJJ3NcsO7qXCC+n+1lx9bHX0+L9zEudiKP7+F6VpPUSoDT8FSitVWSdGnK0nViTjdRPLbFrvys1ZuH7XB0wcFTp0kCDG6tZg8Uj/JAeq4eJLolbm3H4/6+yY4Xw42t1V44Ds90qKlmOTpI0274LpSKi9jJDnHJK3A3wwRFWVH0478iPmluxn81yDVpXffi2kPOwqzdH/z1ouRohufGGT4d5Rwu2Rb7+9OnaPzfULtfv4c4OkEvCwGmpuNRmH5QO0KrSDeRFbXTpFU7th+VI2ECXxah7axr0aBFrpZNL8u1ZNf3k7BW9h6/p1eCYiH1m16dgt6WglB18sKb2ZqtevkQabnGp5tZV3MLSAIbCm1OzY6CKxvSDd2Q6Xb9ZttN8I48jIjyRMKTRzP0GNZwwEoHyAoBC3jJOMzTAO4k13QkZdXLoVvYnZTQl36hQGBAWL3whEKhaqRmmrwi22xXanLRsPofWfgLR1mG+wpTN628ODDsezjDID5l90BraCnq+ZoG+LRnnn0yOHgE2a5VxASPqyjAyUCCkJiEVzOBn9FHNfAZEQ+vFafWjZeR5npXKtJBkAxhAPVD6Jla8rvUMc3lIERwVwpzxODJqvpWF4p/Bn+boNBxAJa/gKyLbcYevRciupchDUyxeoIDGwFTSr/tWCsmbXWrnR7hfsec09HhAHry726J3ytqUE8jG1/29EXQ/0bb0tfy+oyvZ3dwo77w8nanDVI5DFAH0utDVCDuPuXgHV7g7U57h9T4LK3xKhbFUmZxnKZ4y8afih0FVMtjgaPnnlt0954TW1Nhwpof/zzc0DYSjLA1R394gx1g'))
						var rstData1 = JSON.parse(decrypt.replace(/[^\x20-\x7E\u4E00-\u9FFF]+/g, ""));
						console.log("个人信息", rstData1, decrypt);
						if(rstData1.code == 200){
							let rstData = rstData1.data;
							if(rstData.CSNY){
								rstData.CSNY = rstData.CSNY.substring(0, 4) + "-" + rstData.CSNY.substring(4, 6) + "-" + rstData.CSNY.substring(6, 8)
							}
							if(rstData.realname){
								rstData.XM = rstData.realname;
								delete rstData.realname;
							}
							const bhyy = rstData.BHYY;
							if(rstData.BHYY){
								delete rstData.BHYY;
							}
							this.baseFormData.personInfo = rstData;
							this.originBasicInfo = JSON.parse(JSON.stringify(rstData));
							if(rstData.STATE_ == '0' 
								||rstData.STATE_ == '1'
								||rstData.STATE_ == '2'
								||rstData.STATE_ == '3'){
								this.baseFormData.reportStatus = rstData.STATE_
							} else {
								this.baseFormData.reportStatus = '4'
							}
							
							if(this.baseFormData.reportStatus == '3' && bhyy){
								uni.showModal({
								        // title: '提交成功',
								        content: '您上次提交的信息被驳回，驳回原因是：' + bhyy,
										showCancel:false,
								        success: res => {
											console.log('res', res)
										}
								})
							}
							// TEST CODE
							// this.baseFormData.reportStatus = '4'
							this.idcardChange(this.baseFormData.personInfo.SFZH);
						}
					},
					fail: (data, code) => {
						console.log('fail', data);
					}
				});
			},
			uploadUserInfo(ref) {
				this.$refs[ref].validate().then(res => {
					console.log('success', res, JSON.stringify(this.baseFormData.personInfo));
					var encrypt = this.aes_encrypt(JSON.stringify(this.baseFormData.personInfo))
					// console.log('===encrypt===',encrypt);
					// var decrypt = this.aes_decrypt(encrypt)
					// console.log('===decrypt===',JSON.parse(decrypt));
					// 提交中
					uni.showLoading({title: '提交中', mask: true });
					uni.request({
						url: apiConfig.api_host + "/wsb/interface/txywryxc.do?action=uploadUserInfo&sign="+ this.$sign + "&data=" + encodeURIComponent(encodeURIComponent(this.aes_encrypt(JSON.stringify(this.baseFormData.personInfo)))),
						// data: {data: aes_encrypt(JSON.stringify(this.baseFormData.personInfo))},
						// method:'POST',
						success: data => {
							uni.hideLoading();
							const jsonStr = this.aes_decrypt(data.data);
							console.log("更新用户返回结果", data, jsonStr);
							var resp = JSON.parse(jsonStr.replace(/[^\x20-\x7E\u4E00-\u9FFF]+/g, ""));
							console.log("数据解密后", resp);
							if(resp.code == 200){
								uni.showModal({
								        // title: '提交成功',
								        content: '个人信息提交成功\n请等待审核通过后,进行下一步下沉单位填报。',
										showCancel:false,
								        success: res => {
											console.log('res', res)
											if (res.confirm) {
												this.getUserInfo();
											} else {
												// 执行取消后的操作
											}
										}
								})
							}
						},
						fail: (data, code) => {
							console.log('fail', data);
						}
					});
				}).catch(err => {
					console.log('err', err);
				})
			},
			idcardChange(e){
				if(this.idcardTool(e, 4)){
					console.log(e, this.idcardTool(e, 1), this.idcardTool(e, 2), this.idcardTool(e, 3))
					this.baseFormData.personInfo.CSNY = this.idcardTool(e, 1);
					this.baseFormData.personInfo.XB = this.idcardTool(e, 2) == '男'?'1':'2';
					this.baseFormData.personInfo.NL = this.idcardTool(e, 3);
				}
			},
			matchBasicInfo(){
				if(this.originBasicInfo.XM == this.baseFormData.personInfo.XM 
					&& this.originBasicInfo.MZ == this.baseFormData.personInfo.MZ
					&& this.originBasicInfo.SFZH == this.baseFormData.personInfo.SFZH
					&& this.originBasicInfo.CSNY == this.baseFormData.personInfo.CSNY
					&& this.originBasicInfo.XB == this.baseFormData.personInfo.XB
					&& this.originBasicInfo.NL == this.baseFormData.personInfo.NL
					&& this.originBasicInfo.ZYZC == this.baseFormData.personInfo.ZYZC
					&& this.originBasicInfo.JSZC == this.baseFormData.personInfo.JSZC
					&& this.originBasicInfo.JG == this.baseFormData.personInfo.JG
					&& this.originBasicInfo.CZD == this.baseFormData.personInfo.CZD
					&& this.originBasicInfo.LXDH == this.baseFormData.personInfo.LXDH
					&& this.originBasicInfo.XCYY == this.baseFormData.personInfo.XCYY
					&& this.originBasicInfo.STZK == this.baseFormData.personInfo.STZK
					&& this.originBasicInfo.UPID_ == this.baseFormData.personInfo.UPID_){
					return true;
				} else {
					return false;
				}
			},
			navTo(p){
				if(this.matchBasicInfo()){
					// 页面路由到：
					console.log('页面路由到：', p)
					uni.navigateTo({
						url: p
					});
					return false;
				} else {
					uni.showModal({
					        content: '您修改了基本信息，请修改提交审核后，才可进入下一步。',
							showCancel:false,
					        success: res => {
								console.log('res', res)
							}
					})
				}
			},
			idcardTool(IdCard, type) {
				if (type === 1) {
					//获取出生日期
					let birthday = IdCard.substring(6, 10) + "-" + IdCard.substring(10, 12) + "-" + IdCard.substring(12, 14)
					return birthday
				}
				if (type === 2) {
					//获取性别
					if (parseInt(IdCard.substr(16, 1)) % 2 === 1) {
						return "男"
					} else {
						return "女"
					}
				}
				if (type === 3) {
					//获取年龄
					var ageDate = new Date()
					var month = ageDate.getMonth() + 1
					var day = ageDate.getDate()
					var age = ageDate.getFullYear() - IdCard.substring(6, 10) - 1
					if (IdCard.substring(10, 12) < month || IdCard.substring(10, 12) === month && IdCard.substring(12, 14) <= day) {
						age++
					}
					if (age <= 0) {
						age = 1
					}
					return age
				}
				if (type == 4){
					var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
					return reg.test(IdCard);
				}
			},
			aes_encrypt:function(word){
				let keyStr = "abc654321abc===+";//加密密钥
				let ivStr  = "abc654321abc===+";//矢量
			    keyStr = keyStr ? keyStr : 'hfhfuu8dolv98bt6';
			    var key  = CryptoJS.enc.Utf8.parse(keyStr);
			    var iv   = CryptoJS.enc.Utf8.parse(ivStr);
			    // var srcs = CryptoJS.enc.Utf8.parse(word);
			    var encrypted = CryptoJS.AES.encrypt(word, key, {
			        iv:iv,
			        mode:CryptoJS.mode.CBC,
			        padding: CryptoJS.pad.Pkcs7});
			    return encrypted.toString();
			},
			 
			//解密  
			aes_decrypt:function(word){
				let keyStr = "abc654321abc===+";//加密密钥
				let ivStr  = "abc654321abc===+";//矢量
			    keyStr = keyStr ? keyStr : 'hfhfuu8dolv98bt6';
			    var key  = CryptoJS.enc.Utf8.parse(keyStr);//
			    var iv   = CryptoJS.enc.Utf8.parse(ivStr);
			    // const restoreBase64 = word.replace(/\-/g,'+').replace(/_/g,'/');
			    var restoreBase64=word.replace(/[\r\n]/g,'');
			 
			    var decrypt = CryptoJS.AES.decrypt(restoreBase64, key, {
			        iv:iv,
			        mode:CryptoJS.mode.CBC,
			        padding: CryptoJS.pad.ZeroPadding});
			    return CryptoJS.enc.Utf8.stringify(decrypt).toString();
			},
			// 实现一：通常情况下使用返回值
			mySearchFn(searchList, searchWord) {
				return searchList.filter(x => x.text.includes(searchWord));
			},
		}
	}
</script>

<style lang="scss" scoped>
	.example {
		padding: 15px;
		background-color: #fff;
	}

	.segmented-control {
		margin-bottom: 15px;
	}

	.button-group {
		margin-top: 15px;
		display: flex;
		justify-content: space-around;
	}

	.form-item {
		display: flex;
		align-items: center;
	}

	.button {
		display: flex;
		align-items: center;
		height: 35px;
		margin-left: 10px;
	}
	.cst-form-item {
		border-bottom:1px #e5e5e5 solid;
	}
	.uni-input-placeholder, .uni-select__input-placeholder{
		color: #999;
		font-size: 12px;
	}
</style>
